Skip to content

test: Create Local Infrastructure for Scanner Testing - #1329

Merged
MR2011 merged 3 commits into
mainfrom
kanstantsinbuklis-sap/issue-1302/create-local-infrastructure-for-scanner-testing
Nov 18, 2026
Merged

MR2011 merged 3 commits into
mainfrom
kanstantsinbuklis-sap/issue-1302/create-local-infrastructure-for-scanner-testing

Conversation

@kanstantsinbuklis-sap

Copy link
Copy Markdown
Collaborator

Description

Local infrastructure for scanners testing

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

@kanstantsinbuklis-sap
kanstantsinbuklis-sap force-pushed the kanstantsinbuklis-sap/issue-1302/create-local-infrastructure-for-scanner-testing branch from f19e420 to 3ad2f07 Compare November 4, 2026 14:25
@kanstantsinbuklis-sap
kanstantsinbuklis-sap marked this pull request as ready for review November 4, 2026 14:27
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved defects can corrupt recorded fixtures, prevent documented local scans from working, and break existing Helm upgrades through default ServiceAccount ownership conflicts.

4 open issues
What changed in this PR

Adds local infrastructure for testing the k8s-assets and keppel scanners against the Heureka backend without access to a remote cluster or registry, addressing issue #1302.

Changes:

  • Adds kind cluster configuration and Makefile targets for setup, scanning, and teardown.
  • Introduces a Keppel/Keystone mock with TLS, fixture overrides, recording mode, and fixture tests.
  • Documents the local workflow and updates playground resources and response models.
File Description
scanner/​playground/​k8s-playground/​templates/​serviceaccounts.yaml Adds default service accounts in playground namespaces.
scanner/​playground/​k8s-playground/​templates/​serviceaccount.yaml Adjusts template whitespace trimming.
scanner/​keppel/​models/​models.go Adds manifest tags, pagination metadata, and JSON tags.
scanner/​keppel/​mock/​tlscert.go Generates an ephemeral self-signed certificate.
scanner/​keppel/​mock/​testdata/​fixtures/​.gitkeep Documents optional fixture overrides.
scanner/​keppel/​mock/​serve.go Starts mock HTTP and HTTPS listeners.
scanner/​keppel/​mock/​record.go Proxies upstream requests and records response fixtures.
scanner/​keppel/​mock/​main.go Adds mock configuration and mode selection.
scanner/​keppel/​mock/​keystone.go Emulates Keystone authentication and version discovery.
scanner/​keppel/​mock/​keppel.go Supplies canned registry and vulnerability responses.
scanner/​keppel/​mock/​fixtures.go Loads and writes fixture overrides.
scanner/​keppel/​mock/​fixtures_test.go Checks response serialization and fixture compatibility.
scanner/​keppel/​go.mod Promotes trivy-db to a direct dependency.
README.md Links to the local scanner guide.
Makefile Adds local environment and scanner commands.
local/​kind/​cluster.yaml Defines the single-node development cluster.
local/​kind/​.gitignore Excludes the generated kubeconfig.
go.sum Updates gRPC checksums.
docs/​local-environment.md Explains setup, scanning, recording, and teardown.

Review effort: Balanced

Comment thread docs/local-environment.md Resolved
Comment thread docs/local-environment.md Resolved
Comment thread scanner/keppel/mock/fixtures.go Resolved
Signed-off-by: Kanstantsin Buklis <kanstantsin.buklis@sap.com>
@kanstantsinbuklis-sap
kanstantsinbuklis-sap force-pushed the kanstantsinbuklis-sap/issue-1302/create-local-infrastructure-for-scanner-testing branch from 0787b62 to 8e6c8e5 Compare November 5, 2026 09:23
@MR2011
MR2011 merged commit a2bd59c into main Nov 18, 2026
11 checks passed
@MR2011
MR2011 deleted the kanstantsinbuklis-sap/issue-1302/create-local-infrastructure-for-scanner-testing branch November 18, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants